﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml;

namespace TestAppliWPF.Files
{
    public class XmlManager
    {
        

        private const string DebugPath = @"..\..\";
        private const string DatabasePath = DebugPath + @"Databases";
        private const string MainMenuFile = DatabasePath + @"\Main Menu\Main Menu.xml";

        /*
        public static void ReadMainMenuFromXml(IEnumerable<GamingSystem> out_systemsList)
        {
            //List<GamingSystem> systemsList = new List<GamingSystem>();
            var listSystemes = new List<String>();

            if (File.Exists(MainMenuFile))
            {
                var fileContent = new StreamReader(MainMenuFile).ReadToEnd();

                // Create an XmlReader
                using (var reader = XmlReader.Create(new StringReader(fileContent)))
                {
                    // Parse the file and display each of the nodes.
                    while (reader.Read())
                    {
                        if (reader.NodeType == XmlNodeType.Element)
                        {
                            if (reader.Name == "game")
                            {
                                String systemName = reader.GetAttribute("name");
                                listSystemes.Add(systemName);
                                GamingSystem system = new GamingSystem(systemName);
                                out_systemsList.Add(system);
                            }
                        }
                    }
                }
            }
            else
            {
                throw new Exception("Le fichier de configuration du menu est absent.");
            }

            // Lire 
        }
         */
    }
}
